package com.sun.springbootfiledownload.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.HandlerExceptionResolver;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import org.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandler;

import java.util.List;

/**
 * @version 1.0
 * @Package: com.sun.springbootfiledownload.config
 * @ClassName: WebConfig
 * @Author: sgq
 * @Date: 2025/4/9 9:58
 * @Description: TODD
 */
//@Configuration
public class WebConfig implements WebMvcConfigurer {

    @Override
    public void configureHandlerExceptionResolvers(List<HandlerExceptionResolver> resolvers) {
        // 禁用 ResponseEntityExceptionHandler
        resolvers.removeIf(resolver -> resolver instanceof ResponseEntityExceptionHandler);
    }
}